/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Yeezus
 */
@Entity
public class FuncBalcao extends Funcionario implements Serializable {

    @ManyToOne
    @NotNull
    @JoinColumn(name = "FARMACIA_ID")
    private Farmacia farmacia;
    
    @OneToMany(mappedBy = "funcBalcao", cascade = CascadeType.REMOVE)
    private List<Venda> vendas;
    
    public FuncBalcao() {    
        this.vendas = new LinkedList<>();
    }

    public FuncBalcao(String username, String nome, String password, String email,Farmacia farmacia) {
        super(username, nome,GrupoFuncionario.GRUPO.FuncionarioBalcao, password, email);
        this.farmacia=farmacia;
        this.vendas = new LinkedList<>();
    }

    public Farmacia getFarmacia() {
        return farmacia;
    }

    public void setFarmacia(Farmacia farmacia) {
        this.farmacia = farmacia;
    }

    public List<Venda> getVendas() {
        return vendas;
    }

    public void setVendas(List<Venda> vendas) {
        this.vendas = vendas;
    }
    
    

}
